<template>
  <van-popup
    v-model:show="modelValue"
    position="bottom"
    :close-on-popstate="true"
    :style="{ height: '100%' }"
  >
    <iframe class="iframe_class" :src="src"></iframe>
    <van-sticky position="bottom" :offset-bottom="25"
      ><div class="u-f u-f-jse p8">
        <van-button block round plain color="#2D65AC" @click="back"
          >退出</van-button
        >
        <van-button class="ml8" block round color="#2D65AC" @click="agree"
          >同意</van-button
        >
      </div></van-sticky
    >
  </van-popup>
</template>

<script setup>
import {} from 'vue'
defineProps({ modelValue: Boolean, src: String })
let emit = defineEmits(['back', 'agree', 'update:modelValue'])
// 协议退出
const back = () => {
  emit('update:modelValue', false)
  emit('back')
}
// 同意协议
const agree = () => {
  emit('update:modelValue', false)
  emit('agree')
}
</script>

<style scoped lang="scss">
.iframe_class {
  border: none;
  margin-top: calc(var(--van-popup-close-icon-margin) * 2);
}
</style>
